#include <stdio.h>
#include <stdlib.h>
#include "minbinheap.h"


bool heap_insert_value(PMinHeap pq, int value){
    int rt = pq -> heap_size;
    if(rt == pq -> capacity) return 0;
    ++pq -> heap_size;
    pq -> heap_array[rt].value = value; 
    while(pq -> heap_array[parent(rt)].value > value)
        swap_node(&(pq -> heap_array[parent(rt)]), &(pq -> heap_array[rt])),
        rt = parent(rt);
    
    return 1;
}